import { createRouter, createWebHistory } from "vue-router";
import Home from '../components/home/Home.vue'
import Order from '../components/order/Order.vue'
import User from '../components/user/User.vue'
import Login from '../components/login/Login.vue'
import Citys from '../components/citys/Citys.vue'
import Info from '../components/info/Info.vue'
const routes = [
	{
		path:'/',
		name:'Home',
		component:Home,
	},
	{
		path:'/order',
		name:'Order',
		component:Order,
	},
	{
		path:'/user',
		name:'User',
		component:User,
	},
	{
		path:'/login',
		name:'Login',
		component:Login,
	},
	{
		path:'/citys',
		name:'Citys',
		component:Citys,
	},
	{
		path:'/info',
		name:'Info',
		component:Info
	}
];

const router = createRouter({
	// 页面刷新之后默认置顶
	scrollBehavior (to, from, savedPosition) {
	return { x: 0, y: 0 }
	},
  history: createWebHistory(process.env.BASE_URL),
  routes,
});
export default router;
